#include<stdio.h>
int main()
{
	int d,t;
	scanf("%d",&t);
	d=t%10+t%100/10+t/100%10+t/1000;
	printf("%d\n",d);
}


